package utils
{
	import mx.core.UIComponent;

	import modules.componentpanel.htmlcomponents.popups.HTMLButtonPopUp;
	import modules.componentpanel.htmlcomponents.popups.HTMLLayoutBasePopUp;

	public class HTMLItemPopUpCreateUtil
	{
		public static function createPopUp(name:String):UIComponent
		{
			var component:UIComponent;
			if (GlobalConfig.ICON_BUTTON_BUTTON == name)
			{
				component=new HTMLButtonPopUp();
			}
			else if (GlobalConfig.ICON_BUTTON_BASIC_LAYOUT == name)
			{
				component=new HTMLLayoutBasePopUp;
			}
			else if (GlobalConfig.ICON_BUTTON_HORIZONTAL_LAYOUT == name)
			{
				component=new HTMLLayoutBasePopUp;
			}
			else if (GlobalConfig.ICON_BUTTON_VERTICAL_LAYOUT == name)
			{
				component=new HTMLLayoutBasePopUp;
			}

			//checking
			if (component == null)
			{
				throw Error(name + "is not supported for editing yet!!!");
			}
			return component;
		}
	}
}
